Skip to content

Conversation

@hbseong97
Copy link
Contributor

###What is this PR for?

in save-as.service.js, if we use URI Data scheme, we could only contain 2MB data in chrome. using the createObjectURL and File API's blob feature, i managed to upgrade the capacity to about 900MB. plus this update is better in debugging too. if we exceed the 2MB limit in URI data scheme, the download just failed with no accurate console log originally, so it was kinda hard to know why this happens. But using this technique, if it exceeds the 900MB limit, the console log points directly about what the problem is. like this : Uncaught RangeError: Failed to construct 'Blob': Array length exceeds supported limit.

https://github.com/apache/zeppelin/blob/master/zeppelin-web/src/app/notebook/save-as/save-as.service.js

###What type of PR is it?

Improvement

###Todos

nothing more i guess

###What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-2850

###How should this be tested?

open zeppelin using chrome. make a table by select, then download it by csv or tsv. the table should be BIG, like really big, (but not that big for companies, which is my case) to test. in the original version if the whole data exceeds 2MB, you could see that the download fails. but using my script, it doesn't fail until it reaches about 900MB~1GB, which is a tremendous improvement.

###Screenshots (if appropriate)

i'll post it later if you really need it. but i'm pretty sure you guys know what i'm talking about :)

###Questions:

Does the licenses files need update? no (i guess)
Is there breaking changes for older versions? no
Does this needs documentation? maybe?

if we use URI Data scheme, we could only contain 2MB data in chrome. using the createObjectURL and File API's blob feature, i managed to upgrade the capacity to about 900MB.
@Leemoonsoo
Copy link
Member

Thanks @imnotkind for great improvement.
Tested this PR and it works well on large data.

However, it removes BOM and multi-byte char does not displayed correctly when open downloaded file with MS Excel. Please see #1151.

Could you handle BOM?

@hbseong97
Copy link
Contributor Author

oh i didn't realize there were certain issues with excel. i included BOM, and i added revokeObjectURL (decrementing reference count) to enable garbage collecting. now unicode works fine!

@Leemoonsoo
Copy link
Member

Thanks for @imnotkind addressing BOM. Tested and LGTM.

CI failure is not related to this change.
Merge to master if no further comment.

@hbseong97 hbseong97 changed the title [ZEPPELIN-2850] [ZEPPELIN-2850] URI Data scheme -> Blob creation Aug 19, 2017
Copy link
Member

@felixcheung felixcheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!

@asfgit asfgit closed this in b21f89f Aug 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants